/*--------------------------------------------------------
Copyright (c) 2010 Apolo Pena

Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
--------------------------------------------------------*/
package org.flashalchemy.ezlib.ezlog.data
{


    /**
     * <b>Description:</b> The <code>EzLogTargetData</code> class is an object used to store a EzLogTargetData and EzLogFilterData per instance.</br>
     * <b>Usage:</b><p/>
     * <pre>
     *      var logTargetPayload:EzLogTargetData = new EzLogTargetData(xml.logTargets.logTarget[i].consoleTitle.toString(),
     * 																	   logTargetList.attribute('type')[i].toString(),
     * 																	   logTargetList.attribute('formatting')[i].toString(),
     * 																	   alpha,
     *                                                                     themeId);
     * </pre>
     */
    public class EzLogTargetData
    {
        /**
         * Optional title for log targets that provide a custom console rather than the default Flex IDE console.</br>
         * If a console title is set in the xml file for a log target that does not provide a custom console then the title will be ignored.
         * If a console title is not set in the xml for a log target that has a console than the default window title is used
         * @return
         * @see org.flashalchemy.ezlib.logging.console.EzConsoleTarget.DEFAULT_WINDOW_TITLE
         */
        public function get consoleTitle():String
        {
            return _consoleTitle;
        }

        /**
         * @private
         * The optional console title
         */
        private var _consoleTitle:String

        /**
         * The type of log target to use, currently the following classes are supported, use the classname from the appropriate string below:<br>
         * <ul><li><code>org.flashalchemy.ezlib.logging.targets.EzTraceTarget</code></li>
         * <li><code>org.flashalchemy.ezlib.logging.targets.EzProgramConsoleTarget</code></li></ul>
         * @see org.flashalchemy.ezlib.logging.data.EzLogDataValidator
         * @return The target type for the log target as parsed from the xml file
         */
        public function get targetType():String
        {
            return _targetType;
        }

        /**
         * @private
         * The target type
         */
        private var _targetType:String

        /**
         * The type of formatting to use for the log target. Currently the valid values are:</br>
         * <ul><li>'default' : Standard <code>EzTraceTarget</code> formatting</li>
         * <li>'verbose' : Standard <code>EzTraceTarget</code> formatting plus package path and full time information</li>
         * <li> 'minimal' : Standard <code>EzTraceTarget</code> formatting with the following changes: Uses truncated Log Levels. Omits timestamp</li>
         * <li> 'blank' : All formatting is removed, just the log message appears</li></li>
         * @return The formatting id parsed from the xml file
         * @see org.flashalchemy.ezlib.logging.data.EzLogDataValidator
         * @see org.flashalchemy.ezlib.logging.targets.EzTraceTarget
         */
        public function get formatting():String
        {
            return _formatting;
        }

        /**
         * @private
         * The formatting id parsed from the xml file
         */
        private var _formatting:String;

        /**
         * The alpha value of a log target that constains a custom console
         * @see org.flashalchemy.ezlib.logging.targets.EzProgramConsoleTarget
         * @return alpha value
         */
        public function get consoleAlpha():Number
        {
            return _consoleAlpha;
        }

        /**
         * @private
         * The alpha for a log target that constains a custom console
         */
        private var _consoleAlpha:Number;

        /**
         * The style of the log target that contains a custom console. Currently the following values are supported:</br><ul>
         * <li>'default' : The default style for a custom console, a white/grey styled console with black text on a white background</li>
         * <li>'monochromatic' : A 'DOS-stlye' monochrome console using color-coded log messages per log level. Displayed on a black background with colored text and green highlights.</li>
         * </ul>
         * @returns The style of the log target that contains a custom console
         */
        public function get consoleThemeId():String
        {
            return _consoleThemeId;
        }

        private var _consoleThemeId:String = null;

        /**
         * Constructor: all values in this data object are read-only and are set via the constructor
         * @param targetType The type of log target, see the <code>targetType</code> variable description for more information.
         * @param formatting The type of formatting to use with the log target, see the <code>targetType</code> variable description for more information.
         * @param consoleAlpha Optional value: The alpha value to use for the console if the log target used contains a custom console. See the <code>consoleAlpha</code> variable description for more information.
         * @param consoleThemeId Optional value: The style to use for the console if the log target used contains a custom console.
         * see the <code>consoleThemeId</code> variable description for more information.
         */
        public function EzLogTargetData(consoleTitle:String, targetType:String, formatting:String, consoleAlpha:Number = 1.0, consoleThemeId:String = null)
        {
            _consoleTitle = consoleTitle;
            _targetType = targetType;
            _formatting = formatting;
            _consoleAlpha = consoleAlpha;
            _consoleThemeId = consoleThemeId;
        }
    }
}

